package com.ueip.backend.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;
import java.beans.Transient;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserInfo {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer uid;
    private String name;
    private String phoneNumber;
    private String idNum;
    private Integer positionId;
    private Integer state;


    private transient  String positionName;
    private transient  String stateName;
    private transient  String username;

    @Transient
    public void mySetStateName() {
        if (this.state == 1) {
            this.stateName = "在职";
        } else {
            this.stateName = "离职";
        }
    }

    public UserInfo(Integer id, Integer uid, String name, String phoneNumber, String idNum, Integer positionId, Integer state) {
        this.id = id;
        this.uid = uid;
        this.name = name;
        this.phoneNumber = phoneNumber;
        this.idNum = idNum;
        this.positionId = positionId;
        this.state = state;
    }
}
